package com.example.post.mapper;

import com.example.post.model.Blog;
import com.example.post.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Optional;

@Mapper
public interface UserMapper {

    Optional<User> findById(int id);
    List<User> findAll();
    int add(User user);
    User queryByName(String username);

    User getByUsernameAndPassword(String username,String password);

   List<User> findAllByUsername(String username);
    void updateUserById(@Param("id") int id, @Param("password") String password);

}
